﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QlrrPrintService.Common.Command
{
    public class BarCode:PrintLocation,IToTSPLCommand
    {

        #region 构造函数

        public BarCode() { }

        #endregion

        #region 变量

        private int _mm_to_dpi = Common.MM_TO_DPI;
        

        /// <summary>
        /// 字串类别
        /// </summary>
        protected string _barcodeType = "128";

        /// <summary>
        /// 条码的高度
        /// </summary>
        private int _barcodeHeight = 10;


        /// <summary>
        /// 是否打印条码码文
        /// </summary>
        private int _isPrintBarcodeFont = 1;

        /// <summary>
        /// 条码旋转的角度0,90,180,270
        /// </summary>
        private int _rotation = 0;

        /// <summary>
        /// 条码窄bar比例因子
        /// </summary>
        private int _narrow = 2;

        /// <summary>
        /// 条码宽bar比例因子
        /// </summary>
        private int _wide = 2;

        /// <summary>
        /// 条码
        /// </summary>
        private string _code = "";

        #endregion

        #region 属性

        protected int Mm_to_dpi
        {
            get { return _mm_to_dpi; }
            set { _mm_to_dpi = value; }
        }

        public new int X
        {
            get { return _x * _mm_to_dpi; }
            set { _x = value; }
        }

        public new int Y
        {
            get { return _y * _mm_to_dpi; }
            set { _y = value; }
        }

        public int BarcodeHeight
        {
            get { return _barcodeHeight * _mm_to_dpi; }
            set { _barcodeHeight = value; }
        }


        public int IsPrintBarcodeFont
        {
            get { return _isPrintBarcodeFont; }
            set { _isPrintBarcodeFont = value; }
        }



        public int Rotation
        {
            get { return _rotation; }
            set { _rotation = value; }
        }



        public int Narrow
        {
            get { return _narrow; }
            set { _narrow = value; }
        }




        public int Wide
        {
            get { return _wide; }
            set { _wide = value; }
        }



        public string Code
        {
            get { return _code; }
            set { _code = value; }
        }

        

        public string BarcodeType
        {
            get { return _barcodeType; }
            set { _barcodeType = value; }
        }

        #endregion



        #region IToTSPLCommand 成员

        public byte[] ToTSPLCommandByte(int mm_to_dot)
        {
            throw new NotImplementedException();
        }

        public string ToTSPLCommandAscii(int mm_to_dot)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
